package com.jml.第二期.utils;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

public class JwtTest {
    final static String  SIGN_KEY = "jml001";
    public static void main(String[] args) {

        JwtBuilder jwtBuilder = Jwts.builder()
                //放入参数
                .claim("phone", "188xxxxxxxx")
                //设置签名   后面是签名的key相当于一个盐值,必须大于3位
                .signWith(SignatureAlgorithm.HS256, SIGN_KEY);
        System.out.println(jwtBuilder.compact());
    }
}
